package br.uvv.Model;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Version;

@Entity
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
public abstract class EntidadeGenerica implements Serializable {

	private static final long serialVersionUID = -806160945681802018L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.TABLE)
	protected Long id;
	
	@Version
	protected Integer version;
	
	public abstract String toJson();
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public Integer getVersion() {
		return version;
	}
	public void setVersion(Integer version) {
		this.version = version;
	}
}